<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ViewGenBankTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:form id="graph">
                <h:outputText value="#{genB.filtered_file.name}" styleClass="engraved"/>
                <br/>
                <p:panel id="graphic" rendered="#{genBankParser.filtered_file.exists()}" styleClass="form">
                    <p:commandLink id="view_file" value="View" ajax="false">  
                        <p:fileDownload value="#{fileController.convert(genBankParser.filtered_file)}"   contentDisposition="inline"/>  
                    </p:commandLink>  
                    <br/>
                    <p:commandLink id="down_file" value="Download" ajax="false">  
                        <p:fileDownload value="#{fileController.convert(genBankParser.filtered_file)}"   />  
                    </p:commandLink>
                    <br/>
                    <p:commandLink id="save_file" value="Save"  action="FilteredView"  actionListener="#{projectController.importGenBank(genBankParser.genbanks,userController.loggedUser)}">
                    </p:commandLink>


                </p:panel>

                <br/>
                <h:outputText value="Key Words: " />  
                <p:pickList   value="#{genBankParser.pf.dual_kw}"  
                              var="field"
                              itemValue="#{field}" 
                              >  
                    <f:facet name="sourceCaption">Available</f:facet>  
                    <f:facet name="targetCaption">Selected</f:facet>  
                    <p:column >  
                        #{field}  
                    </p:column>  
                </p:pickList>
                <h:outputText value="Sub Key Words:" /> 
                <p:pickList   value="#{genBankParser.pf.dual_skw}"  
                              var="field" 
                              itemValue="#{field}" 
                              >  
                    <f:facet name="sourceCaption">Available</f:facet>  
                    <f:facet name="targetCaption">Selected</f:facet>  

                    <p:column >  
                        #{field}  
                    </p:column>  
                </p:pickList>
                <h:outputText value="Feature Keys:" />  
                <p:pickList   value="#{genBankParser.pf.dual_fkw}"  
                              var="field" 
                              itemValue="#{field}" 
                              >  
                    <f:facet name="sourceCaption">Available</f:facet>  
                    <f:facet name="targetCaption">Selected</f:facet>  

                    <p:column >  
                        #{field}  
                    </p:column>  
                </p:pickList>  
                <h:outputText value="Qualifiers:" />  
                <p:pickList   value="#{genBankParser.pf.dual_qkw}"  
                              var="field" 
                              itemValue="#{field}" 
                              >  
                    <f:facet name="sourceCaption">Available</f:facet>  
                    <f:facet name="targetCaption">Selected</f:facet>  

                    <p:column  >  
                        #{field}  
                    </p:column>  
                </p:pickList>  


                <p:commandButton id="generate" icon="ui-icon-arrowrefresh-1-w" update=":graph:" value="Filter"  action="FilteredView" actionListener="#{genBankParser.export}" >
                </p:commandButton>

                <br/>
                <p:blockUI block=":graph:" trigger="generate,view_file,down_file,save_file">  
                    <h:outputText value="Please wait, data is being processed..." />  <br/>
                    <p:graphicImage value="/resources/ajaxloader.gif"/>  
                </p:blockUI> 
            </h:form>
        </ui:define>
    </ui:composition>

</html>
